package com.evil.application.api;

import com.evil.application.config.FeignErrorDecoder;
import com.evil.application.pojo.dto.statistics.*;
import com.evil.common.application.dto.order.OrderPageDataRespDTO;
import com.evil.common.core.constant.ServiceNameConstant;
import com.evil.common.core.entity.QueryModel;
import com.github.pagehelper.PageInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 应用统计接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@FeignClient(name = ServiceNameConstant.APPLICATION_SERVICE, configuration = {FeignErrorDecoder.class})
public interface RemoteApplicationStatisticsService {

    /**
     * 统计登录人待办
     *
     * @param statisticsAppDataReqDTO statisticsAppDataReqDTO
     * @return StatisticsRespDTO 列表
     */
    @PostMapping("/remote/application/statistics/query-type")
    List<StatisticsRespDTO> statistics(@Validated @RequestBody StatisticsAppDataReqDTO statisticsAppDataReqDTO);

    /**
     * 统计登录人待办
     *
     * @return List
     */
    @PostMapping("/remote/application/statistics/pending")
    List<StatisticsPendingRespDTO> statisticsPending();

    /**
     * 登录人待办page
     *
     * @param queryModel queryModel
     * @return List
     */
    @PostMapping("/remote/application/statistics/pending/page")
    PageInfo<OrderPageDataRespDTO> statisticsPendingPage(@Validated @RequestBody QueryModel<StatisticsPendingPageReqDTO> queryModel);

    /**
     * 统计所有订单
     *
     * @return List
     */
    @PostMapping("/remote/application/statistics/order")
    List<StatisticsOrderRespDTO> statisticsOrder();

    /**
     * 登录人订单page
     *
     * @param queryModel queryModel
     * @return List
     */
    @PostMapping("/remote/application/statistics/order/page")
    PageInfo<OrderPageDataRespDTO> statisticsOrderPage(@Validated @RequestBody QueryModel<StatisticsOrderPageReqDTO> queryModel);

    /**
     * 统计单个app订单
     *
     * @param statisticsAppDataReqDTO statisticsAppDataReqDTO
     * @return List
     */
    @PostMapping("/remote/application/app/order")
    List<StatisticsOrderRespDTO> statisticsAppOrder(@Validated @RequestBody StatisticsAppDataReqDTO statisticsAppDataReqDTO);
}
